package com.baozhun.mall.common.util

import com.blankj.utilcode.util.AppUtils

/**
 * @Description:
 * @Author: xuefeng.zhu
 * @CreateDate: 2020-08-18
 * @Version: 1.0
 */
object SystemUtil {

    /**
     * 是否为鸿蒙系统
     *
     * @return true为鸿蒙系统
     */
    fun isHarmonyOs(): Boolean {
        return try {
            val buildExClass = Class.forName("com.huawei.system.BuildEx")
            val osBrand = buildExClass.getMethod("getOsBrand").invoke(buildExClass)
            "Harmony".equals(osBrand.toString(), ignoreCase = true)
        } catch (x: Throwable) {
            false
        }

    }

}
